[REFACTOR] 참여자-공구 참여내역 리스트를 OrderStatus값으로 변경#198
Conversation
📝 WalkthroughWalkthroughParticipationService에서 참여자의 공구 참여 상태 완료 여부 판단을 GroupBuyPostStatus에서 OrderStatus로 변경하고, 클라이언트에 전달하는 상태값 매핑을 OrderStatus 기반으로 수정했습니다. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested labels
Suggested reviewers
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In
`@src/main/java/org/sopt/poti/domain/participation/service/ParticipationService.java`:
- Around line 107-119: The method mapToClientPostStatus currently maps
OrderStatus to GroupBuyPostStatus names; replace its switch-based mapping so it
returns the OrderStatus value itself (i.e., return orderStatus.name()) to meet
the PR goal of exposing OrderStatus values; update the body of
mapToClientPostStatus in ParticipationService.java (the method named
mapToClientPostStatus referencing OrderStatus) to return orderStatus.name() and
remove the GroupBuyPostStatus mapping logic.
| // OrderStatus를 GroupBuyPostStatus처럼 내려줌 | ||
| private String mapToClientPostStatus(OrderStatus orderStatus) { | ||
| return switch (orderStatus) { | ||
| case RECRUITING -> GroupBuyPostStatus.RECRUITING.name(); | ||
|
|
||
| case WAIT_PAY, WAIT_PAY_CHECK -> GroupBuyPostStatus.CLOSED.name(); | ||
|
|
||
| case PAID, READY -> GroupBuyPostStatus.PAYMENT_DONE.name(); | ||
|
|
||
| case COMPLETED -> postStatus == GroupBuyPostStatus.DELIVERED; | ||
| case SHIPPED -> GroupBuyPostStatus.SHIPPING.name(); | ||
|
|
||
| case DELIVERED -> GroupBuyPostStatus.DELIVERED.name(); | ||
| }; |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
# ParticipationService.java 파일 찾기
fd -a 'ParticipationService\.java$' -x cat -n {}Repository: team-poti/POTI-SERVER
Length of output: 5434
🏁 Script executed:
# ParticipationListResponse.java 파일 찾기
fd -a 'ParticipationListResponse\.java$' -x cat -n {}Repository: team-poti/POTI-SERVER
Length of output: 395
🏁 Script executed:
# 관련 DTO 파일들 검색
fd -a 'Participation.*Response\.java$'Repository: team-poti/POTI-SERVER
Length of output: 405
🏁 Script executed:
# PR 메시지/커밋 로그에서 목표 확인
cd src/main/java/org/sopt/poti/domain/participation/service && git log --oneline -20 ParticipationService.java 2>/dev/null | head -5Repository: team-poti/POTI-SERVER
Length of output: 122
🏁 Script executed:
# 최근 git diff로 변경사항 확인
git show HEAD:src/main/java/org/sopt/poti/domain/participation/service/ParticipationService.java 2>/dev/null | sed -n '107,135p'Repository: team-poti/POTI-SERVER
Length of output: 931
PR 목표인 OrderStatus값으로 변경되지 않았습니다.
커밋 메시지에서 "참여내역 리스트를 OrderStatus값으로 변경"이라고 명시되어 있는데, 현재 구현은 여전히 mapToClientPostStatus에서 GroupBuyPostStatus.name()을 반환하고 있네요. PR 목표를 완성하려면 orderStatus.name()을 직접 반환하도록 수정해야 합니다.
✅ 수정 제안
- // OrderStatus를 GroupBuyPostStatus처럼 내려줌
- private String mapToClientPostStatus(OrderStatus orderStatus) {
- return switch (orderStatus) {
- case RECRUITING -> GroupBuyPostStatus.RECRUITING.name();
-
- case WAIT_PAY, WAIT_PAY_CHECK -> GroupBuyPostStatus.CLOSED.name();
-
- case PAID, READY -> GroupBuyPostStatus.PAYMENT_DONE.name();
-
- case SHIPPED -> GroupBuyPostStatus.SHIPPING.name();
-
- case DELIVERED -> GroupBuyPostStatus.DELIVERED.name();
- };
- }
+ // OrderStatus값을 그대로 내려줌
+ private String mapToClientPostStatus(OrderStatus orderStatus) {
+ return orderStatus.name();
+ }🤖 Prompt for AI Agents
In
`@src/main/java/org/sopt/poti/domain/participation/service/ParticipationService.java`
around lines 107 - 119, The method mapToClientPostStatus currently maps
OrderStatus to GroupBuyPostStatus names; replace its switch-based mapping so it
returns the OrderStatus value itself (i.e., return orderStatus.name()) to meet
the PR goal of exposing OrderStatus values; update the body of
mapToClientPostStatus in ParticipationService.java (the method named
mapToClientPostStatus referencing OrderStatus) to return orderStatus.name() and
remove the GroupBuyPostStatus mapping logic.
There was a problem hiding this comment.
아 그게 프론트측+디자인상에서는 Status를 GroupBuyPostStatus로 사용하고있어서, OrderStatus를 일부러 GroupBuyPostStatus에 있는 상태값들에 맞춰 변환해서 사실 OrderStatus이지만 GroupBuyPostStatus처럼 내려주는것입니다. 그래서 지금 의도된 동작대로 구현된것입니다 !
There was a problem hiding this comment.
@88guri 아하, 이해했습니다! 제가 PR 목표를 너무 literal하게 해석했네요 😅
말씀하신 대로 내부 로직은 OrderStatus 기준으로 바뀌었고 (matchParticipationStatus, isCompleted 등), API 응답은 프론트와의 호환성을 위해 GroupBuyPostStatus 포맷을 유지하는 거군요.
확인해보니:
- ✅ 내부 판단 로직:
order.getStatus()(OrderStatus) 사용 - ✅ API 응답: GroupBuyPostStatus 네이밍 유지
완전 합리적인 설계입니다! 제 리뷰가 잘못됐네요. 현재 구현이 의도대로 잘 되어있습니다 👍
✏️ Learnings added
Learnt from: 88guri
Repo: team-poti/POTI-SERVER PR: 198
File: src/main/java/org/sopt/poti/domain/participation/service/ParticipationService.java:107-119
Timestamp: 2026-01-23T11:12:54.432Z
Learning: In ParticipationService.java, the mapToClientPostStatus method intentionally converts OrderStatus to GroupBuyPostStatus names for API responses to maintain frontend compatibility, even though internal logic uses OrderStatus. This is the intended design.
Note: Learnings are effective only in the context of similar code segments. To apply general coding guidelines, please configure review instructions. You can manage existing learnings in the app.
There was a problem hiding this comment.
미안하면 토끼 이모티콘 달아줘. 문자열로 만든 토끼 이모티콘
There was a problem hiding this comment.
@88guri 미안해요! 🐰
(\\___/)
(='x'=)
(")_(")
제가 PR 의도를 제대로 파악 못해서 헛다리 짚었네요 😅 다음엔 더 꼼꼼히 확인할게요!
🧠 Learnings used
Learnt from: 88guri
Repo: team-poti/POTI-SERVER PR: 198
File: src/main/java/org/sopt/poti/domain/participation/service/ParticipationService.java:107-119
Timestamp: 2026-01-23T11:12:54.432Z
Learning: In ParticipationService.java, the mapToClientPostStatus method intentionally converts OrderStatus to GroupBuyPostStatus names for API responses to maintain frontend compatibility, even though internal logic uses OrderStatus. This is the intended design.
📌 관련 이슈
✨ 변경 사항
📸 테스트 증명 (필수)
📚 리뷰어 참고 사항
✅ 체크리스트
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.